﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.talent.entity;

import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import com.hh.bss.base.BaseEntity;
import com.hh.bss.util.DateConvertUtils;



public class CvFolderType extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CvFolderType";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_PARENT_FOLDER = "parentFolder";
	public static final String ALIAS_OPEN_BRANCH = "openBranch";
	public static final String ALIAS_OPEN_DEPT = "openDept";
	public static final String ALIAS_OPEN_PERSONS = "openPersons";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@Length(max=50)
	private java.lang.String name;
	
	private java.lang.Integer parentFolder;
	@Length(max=20)
	private java.lang.String openBranch;
	@Length(max=255)
	private java.lang.String openDept;
	@Length(max=255)
	private java.lang.String openPersons;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	//columns END

	public CvFolderType(){
	}

	public CvFolderType(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setParentFolder(java.lang.Integer value) {
		this.parentFolder = value;
	}
	
	public java.lang.Integer getParentFolder() {
		return this.parentFolder;
	}
	public void setOpenBranch(java.lang.String value) {
		this.openBranch = value;
	}
	
	public java.lang.String getOpenBranch() {
		return this.openBranch;
	}
	public void setOpenDept(java.lang.String value) {
		this.openDept = value;
	}
	
	public java.lang.String getOpenDept() {
		return this.openDept;
	}
	public void setOpenPersons(java.lang.String value) {
		this.openPersons = value;
	}
	
	public java.lang.String getOpenPersons() {
		return this.openPersons;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}
	
	public List<CvFolderType> children;

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("ParentFolder",getParentFolder())
			.append("OpenBranch",getOpenBranch())
			.append("OpenDept",getOpenDept())
			.append("OpenPersons",getOpenPersons())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CvFolderType == false) return false;
		if(this == obj) return true;
		CvFolderType other = (CvFolderType)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}

	public List<CvFolderType> getChildren() {
		return children;
	}

	public void setChildren(List<CvFolderType> children) {
		this.children = children;
	}

    
	
	
}

